package io.renren.modules.file.service;

import com.baomidou.mybatisplus.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.file.entity.SysUploadFileEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * @author luhongda
 * @email 18018377793
 * @date 2019-02-18 20:30:06
 */
public interface SysUploadFileService extends IService<SysUploadFileEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 保存文件
     * @param request
     * @param file
     * @return
     * @throws Exception
     */
    R saveFile(MultipartFile request, SysUploadFileEntity file) throws Exception;

    /**
     * 删除文件
     * @return
     */
    R deleteFile(String objectId);

    /**
     * 下载word文件
     * @return
     */
    R downLoadWord(Map<String,Object> map, HttpServletRequest request, HttpServletResponse response) throws IOException;
}

